{% extends "base.html"%}
{% block head %}
{{ super() }}
<link rel="stylesheet" href="{{ url_for('static', filename='css/users.css') }}">
{% endblock %}
{% block content %}
<div class="container">
    <h1>Users:</h1>
    <button class="btn btn-primary" onclick="location.href='/create_user'" class="button-create-user">Create user</button>
    <br></br>
<table aria-describedby="users-table-description" class="users-table">
    <tr class="head-user-table">
        <th>Username</th>
        <th>Role</th>
        <th>Actions</th>
    </tr>
    {% for user in users %}
    <tr class="body-user-table">
        <td>{{ user.username }}</td>
        <td>{{ user.role }}</td>
        <td>
            <button class="btn btn-danger" onclick="location.href='/delete_user/{{ user.id }}'">Delete</button>
        </td>
    </tr>
    {% endfor %}
</table>
</div>
{% endblock %}
